﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Controls="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient;assembly=Sinacor.Infra.UI.Controls">

    <!--BEGIN SLIDER-->
    <!--BEGIN REPEAT BUTTON-->
    <Style x:Key="ControlSliderRepeatButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border Background="Transparent"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--END REPEAT BUTTON-->

    <!--BEGIN THUMB-->
    <Style x:Key="ControlHorizontalSliderThumb" TargetType="{x:Type Thumb}">
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Height" Value="22"/>
        <Setter Property="Width" Value="11"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Canvas SnapsToDevicePixels="true" Margin="8,0,0,0">
                        <Canvas.RenderTransform>
                            <TranslateTransform X="5.5" Y="11"/>
                        </Canvas.RenderTransform>
                        <Rectangle x:Name="slider_horizontal" Width="13.703" Height="7" Stretch="Fill" StrokeLineJoin="Round" Stroke="{DynamicResource BrushSliderThumbBorder}" Canvas.Left="-8.203" Canvas.Top="-4.25" Fill="{DynamicResource BrushHorizontalSliderThumbBackground}"/>
                    </Canvas>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Stroke" Value="{DynamicResource BrushSliderThumbBorderHover}" TargetName="slider_horizontal"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushHorizontalSliderThumbBackgroundHover}" TargetName="slider_horizontal"/>
                        </Trigger>
                        <Trigger Property="IsMouseCaptured" Value="True">
                            <Setter Property="Stroke" Value="{DynamicResource BrushSliderThumbBorderPressed}" TargetName="slider_horizontal"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushHorizontalSliderThumbBackgroundPressed}" TargetName="slider_horizontal"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Stroke" Value="{DynamicResource BrushSliderThumbBorderDisabled}" TargetName="slider_horizontal"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushHorizontalSliderThumbBackgroundDisabled}" TargetName="slider_horizontal"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="ControlVerticalSliderThumb" TargetType="{x:Type Thumb}">
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Width" Value="22"/>
        <Setter Property="Height" Value="11"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Canvas SnapsToDevicePixels="true">
                        <Canvas.RenderTransform>
                            <TransformGroup>
                                <TransformGroup.Children>
                                    <TransformCollection>
                                        <RotateTransform Angle="-90"/>
                                        <TranslateTransform X="11" Y="5.5"/>
                                    </TransformCollection>
                                </TransformGroup.Children>
                            </TransformGroup>
                        </Canvas.RenderTransform>
                        <Rectangle x:Name="slider_vertical" Width="7" Height="13.7031" Stretch="Fill" StrokeLineJoin="Round" Stroke="{DynamicResource BrushSliderThumbBorder}" Canvas.Left="-4.319" RenderTransformOrigin="0.5,0.5" Canvas.Top="-7.437" Fill="{DynamicResource BrushVerticalSliderThumbBackground}">
                            <Rectangle.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="1" ScaleY="1"/>
                                    <SkewTransform AngleX="0" AngleY="0"/>
                                    <RotateTransform Angle="90"/>
                                    <TranslateTransform X="0" Y="0"/>
                                </TransformGroup>
                            </Rectangle.RenderTransform>
                        </Rectangle>
                    </Canvas>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Stroke" Value="{DynamicResource BrushSliderThumbBorderHover}" TargetName="slider_vertical"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushVerticalSliderThumbBackgroundHover}" TargetName="slider_vertical"/>
                        </Trigger>
                        <Trigger Property="IsMouseCaptured" Value="True">
                            <Setter Property="Stroke" Value="{DynamicResource BrushSliderThumbBorderPressed}" TargetName="slider_vertical"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushVerticalSliderThumbBackgroundPressed}" TargetName="slider_vertical"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Stroke" Value="{DynamicResource BrushSliderThumbBorderDisabled}" TargetName="slider_vertical"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushVerticalSliderThumbBackgroundDisabled}" TargetName="slider_vertical"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--END THUMB-->

    <Style TargetType="{x:Type Controls:SinacorHorizontalSlider}">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Orientation" Value="Horizontal"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Width" Value="100" />
        <Setter Property="Height" Value="20" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Controls:SinacorHorizontalSlider}">
                    <Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" VerticalAlignment="Center">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Rectangle x:Name="Rectangle" Grid.RowSpan="3" StrokeDashArray="4 2" Stroke="{DynamicResource BrushSliderBorderFocused}" StrokeThickness="0"/>
                            <Border Margin="5,-1,5,0" VerticalAlignment="center" Height="4.0" Background="{DynamicResource BrushHorizontalSliderBackground}" BorderBrush="{DynamicResource BrushHorizontalSliderBorder}" BorderThickness="1" CornerRadius="1" Grid.Row="1">
                                <Canvas>
                                    <Rectangle StrokeThickness="1.0" x:Name="PART_SelectionRange" Height="4.0" Visibility="Hidden"/>
                                </Canvas>
                            </Border>
                            <Track x:Name="PART_Track" Grid.Row="1" Margin="0,0,13,0">
                                <Track.DecreaseRepeatButton>
                                    <RepeatButton Style="{DynamicResource ControlSliderRepeatButton}" Command="{x:Static Slider.DecreaseLarge}"/>
                                </Track.DecreaseRepeatButton>
                                <Track.IncreaseRepeatButton>
                                    <RepeatButton Style="{DynamicResource ControlSliderRepeatButton}" Command="{x:Static Slider.IncreaseLarge}"/>
                                </Track.IncreaseRepeatButton>
                                <Track.Thumb>
                                    <Thumb x:Name="Thumb" Style="{DynamicResource ControlHorizontalSliderThumb}"/>
                                </Track.Thumb>
                            </Track>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelectionRangeEnabled" Value="true">
                            <Setter Property="Visibility" TargetName="PART_SelectionRange" Value="Visible"/>
                        </Trigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter Property="StrokeThickness" Value="1" TargetName="Rectangle"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type Controls:SinacorVerticalSlider}">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Orientation" Value="Vertical"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Height" Value="100" />
        <Setter Property="Width" Value="20" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Controls:SinacorVerticalSlider}">
                    <Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" HorizontalAlignment="Center">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition MinWidth="{TemplateBinding MinWidth}" Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Rectangle x:Name="Rectangle" Grid.ColumnSpan="3" StrokeDashArray="4 2" Stroke="{DynamicResource BrushSliderBorderFocused}" StrokeThickness="0"/>
                            <Border HorizontalAlignment="center" Margin="-1,5,0,5" Width="4.0" Background="{DynamicResource BrushHorizontalSliderBackground}" BorderBrush="{DynamicResource BrushVerticalSliderBorder}" BorderThickness="1" CornerRadius="1" Grid.Column="1">
                                <Canvas Margin="-1,-6">
                                    <Rectangle StrokeThickness="1.0" x:Name="PART_SelectionRange" Width="4.0" Visibility="Hidden" Margin="0,0,0,10"/>
                                </Canvas>
                            </Border>
                            <Track x:Name="PART_Track" Grid.Column="1" Margin="0,6,0,6">
                                <Track.DecreaseRepeatButton>
                                    <RepeatButton Style="{DynamicResource ControlSliderRepeatButton}" Command="{x:Static Slider.DecreaseLarge}"/>
                                </Track.DecreaseRepeatButton>
                                <Track.IncreaseRepeatButton>
                                    <RepeatButton Style="{DynamicResource ControlSliderRepeatButton}" Command="{x:Static Slider.IncreaseLarge}"/>
                                </Track.IncreaseRepeatButton>
                                <Track.Thumb>
                                    <Thumb x:Name="Thumb" Style="{DynamicResource ControlVerticalSliderThumb}"/>
                                </Track.Thumb>
                            </Track>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelectionRangeEnabled" Value="true">
                            <Setter Property="Visibility" TargetName="PART_SelectionRange" Value="Visible"/>
                        </Trigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter Property="StrokeThickness" Value="1" TargetName="Rectangle"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ControlZoomSlider" TargetType="{x:Type Controls:SinacorVerticalSlider}">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Orientation" Value="Vertical"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Height" Value="100" />
        <Setter Property="Width" Value="20" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Controls:SinacorVerticalSlider}">
                    <Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" HorizontalAlignment="Center">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition MinWidth="{TemplateBinding MinWidth}" Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Border HorizontalAlignment="center" Margin="-1,5,0,5" Width="4.0" Background="{DynamicResource BrushHorizontalSliderBackground}" BorderBrush="{DynamicResource BrushVerticalSliderBorder}" BorderThickness="1" CornerRadius="1" Grid.Column="1">
                                <Canvas Margin="-1,-6">
                                    <Rectangle StrokeThickness="1.0" x:Name="PART_SelectionRange" Width="4.0" Visibility="Hidden" Margin="0,0,0,10"/>
                                </Canvas>
                            </Border>
                            <Track x:Name="PART_Track" Grid.Column="1" Margin="0,6,0,6">
                                <Track.DecreaseRepeatButton>
                                    <RepeatButton Style="{DynamicResource ControlSliderRepeatButton}" Command="{x:Static Slider.DecreaseLarge}"/>
                                </Track.DecreaseRepeatButton>
                                <Track.IncreaseRepeatButton>
                                    <RepeatButton Style="{DynamicResource ControlSliderRepeatButton}" Command="{x:Static Slider.IncreaseLarge}"/>
                                </Track.IncreaseRepeatButton>
                                <Track.Thumb>
                                    <Thumb x:Name="Thumb" Style="{DynamicResource ControlVerticalSliderThumb}"/>
                                </Track.Thumb>
                            </Track>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelectionRangeEnabled" Value="true">
                            <Setter Property="Visibility" TargetName="PART_SelectionRange" Value="Visible"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--END SLIDER-->
</ResourceDictionary>